/**
 * 现金收费工厂类
 * @author shuang
 * @date 2021/12/12 23:59
 */
public class CashFactory {

    /**
     * 返回现金收费对象
     * @param type 指定现金收费的类型
     * @return 根据类型返回相应的现金收费子类
     */
    public static CashSuper createCashAccept(String type) {
        CashSuper cs = null;
        switch (type) {
            case "正常收费":
                cs = new CashNormal();
                break;
            case "打 8 折":
                cs = new CashRebate("0.8");
                break;
            case "满 300 返 100":
                cs = new CashReturn("300", "100");
                break;
            default:
                break;
        }
        return cs;
    }
}

